| Einhugur Xml Plugin for Xojo |
|
XPathQuery.EvaluateNodeSet Method
Evaluates a query to a node set.
Parameters
- node
- The node to run the XPath query on.
Returns
- EinhugurXml.XPathNodeSet
- XPathNodeSet which can carry either set of nodes or set of attributes.
Remarks
Note that XPath queries can throw EinhugurXPathException.
var f as FolderItem = SpecialFolder.Resources.Child("xgconsole.xml")
if not f.Exists then
MessageBox("Could not find file xgconsole.xml")
return
end if
using EinhugurXml
try
var document as Document = Document.FromFile(f)
var queryRemoteTools as XPathQuery = new XPathQuery("/Profile/Tools/Tool[@AllowRemote='true']")
var tools as XPathNodeSet = queryRemoteTools.EvaluateNodeSet(document)
ListBox1.RemoveAllRows()
for each node as XPathNode in tools.XPathNodes
ListBox1.AddRow(node.Node.Name + ": " + node.Node.Attribute("Filename").AsString())
next
catch ex as EinhugurXmlParserException
MessageBox(ex.Message + " - Offset:" + ex.Offset.ToString())
catch ex as EinhugurXPathException
MessageBox(ex.Message + " - Offset:" + ex.Offset.ToString())
end try
See Also
XPathQuery Class